package seriable;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Serializable;

public class FinalVariable {
	
	public static void main(String[] args) {
		try {
//			SerializationUtil.writeObject(new FinaleSeriable());
			FinaleSeriable f = (FinaleSeriable) SerializationUtil.readObject();
			System.out.println(f.getNAME());
			System.out.println(f.getAGE());
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}

}

class FinaleSeriable implements Serializable{
	private static final long serialVersionUID = 1L;
	
	private final String NAME = initName();
	private final Integer AGE;
	
	public FinaleSeriable(){
		System.out.println("run Construct");
//		NAME = "¹С¹";
		AGE = 23;
	}

	private String initName() {
		System.out.println("initName");
		return "¹С¹";
	}

	public String getNAME() {
		return NAME;
	}

	public Integer getAGE() {
		return AGE;
	}
	
}